﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;

namespace BiliBiliCSharpStudy.old {
    class EventDemo01 {
        public static void Demo() {
            Test1();
        }

        public static void Test1() {
            Timer timer = new Timer();
            timer.Interval = 1000;
            Boy1 boy = new Boy1();
            Girl1 girl = new Girl1();
            timer.Elapsed += boy.Action;
            timer.Elapsed += girl.Action;
            timer.Start();
            Console.ReadLine();
        }
    }

    class Boy1 {
        internal void Action(object sender, ElapsedEventArgs e) {
            //throw new NotImplementedException();
            Console.WriteLine("Jump!");
        }
    }

    class Girl1 {
        internal void Action(object sender, ElapsedEventArgs e) {
            //throw new NotImplementedException();
            Console.WriteLine("Sing!");
        }
    }
}
